import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class EncodeTest {

	public static void main(String[] args) throws  Exception{
		
		// 201521123012
		BufferedReader br=null;
		try{
			FileInputStream fis=new FileInputStream("EncodeTest.tex");
			InputStreamReader isr=new InputStreamReader(fis,"UTF-8");
			br=new BufferedReader(isr);
			String line=null;
			while((line=br.readLine()) != null){
				System.out.println(line);	
			} 
		}finally{
				if(br!=null){
					br.close();
				}			
		}
		}
	
	public void convertGBK2UTF8(String src, String dst) throws IOException{
		BufferedReader br=new BufferedReader(new FileReader(src));
		OutputStreamWriter osw=new OutputStreamWriter(new FileOutputStream(dst),"UTF-8");
		String line=null;
		while((line=br.readLine())!=null){
			osw.write(line+"\n");
			}
		br.close();
		osw.close();
		}
}


